/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package PropertyRental.ejb.persistence;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/**
 *
 * @author Bast
 */
@Entity
public class Property implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    private String type;
    private String adress;
    private int numberBedroom;
    private int numberBathroom;
    private int numberOtherRoom;
    private double rent;
    private String location;
    @OneToMany
    private List<VisitingProperty> visitsRegistered;
    @OneToMany
    private List<PropertyRent> rentsProperty;

    public Property() {
    }

        /** Creates a new instance of Property */
    public Property(String type, String adress, int numberBedroom, int numberBathroom,
            int numberOtherRoom, double rent, String location) {
        this.type=type;
        this.adress=adress;
        this.numberBedroom=numberBedroom;
        this.numberBathroom=numberBathroom;
        this.numberOtherRoom=numberOtherRoom;
        this.rent=rent;
        this.location=location;
    }
    
    public List<PropertyRent> getRentsProperty() {
        return rentsProperty;
    }

    public void setRentsProperty(List<PropertyRent> rentsProperty) {
        this.rentsProperty = rentsProperty;
    }

    public List<VisitingProperty> getVisitsRegistered() {
        return visitsRegistered;
    }

    public void setVisitsRegistered(List<VisitingProperty> visitsRegistered) {
        this.visitsRegistered = visitsRegistered;
    }

    public String getAdress() {
        return adress;
    }

    public void setAdress(String adress) {
        this.adress = adress;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public int getNumberBathroom() {
        return numberBathroom;
    }

    public void setNumberBathroom(int numberBathroom) {
        this.numberBathroom = numberBathroom;
    }

    public int getNumberBedroom() {
        return numberBedroom;
    }

    public void setNumberBedroom(int numberBedroom) {
        this.numberBedroom = numberBedroom;
    }

    public int getNumberOtherRoom() {
        return numberOtherRoom;
    }

    public void setNumberOtherRoom(int numberOtherRoom) {
        this.numberOtherRoom = numberOtherRoom;
    }

    public double getRent() {
        return rent;
    }

    public void setRent(double rent) {
        this.rent = rent;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Property)) {
            return false;
        }
        Property other = (Property) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "PropertyRental.ejb.beans.Property[id=" + id + "]";
    }

}
